﻿using System;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
using System.Runtime.CompilerServices;
using AutoR.Helpers;
using AutoR.Services;
using LiteDB;
using Newtonsoft.Json;
using Prism.Mvvm;

namespace AutoR.Models
{
	// Token: 0x0200020E RID: 526
	public class RuleFleet : BindableBase
	{
		// Token: 0x170003D2 RID: 978
		// (get) Token: 0x06000C56 RID: 3158 RVA: 0x0006E7B9 File Offset: 0x0006C9B9
		// (set) Token: 0x06000C57 RID: 3159 RVA: 0x0006E7C4 File Offset: 0x0006C9C4
		[JsonConverter(typeof(IntConverter))]
		public int Type
		{
			[CompilerGenerated]
			get
			{
				return this.<Type>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<Type>k__BackingField == value)
				{
					return;
				}
				this.<Type>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.TypeA);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.TypeB);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.TypeC);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Type);
			}
		}

		// Token: 0x170003D3 RID: 979
		// (get) Token: 0x06000C58 RID: 3160 RVA: 0x0006E812 File Offset: 0x0006CA12
		[BsonIgnore]
		public bool TypeA
		{
			get
			{
				return this.Type == 0;
			}
		}

		// Token: 0x170003D4 RID: 980
		// (get) Token: 0x06000C59 RID: 3161 RVA: 0x0006E81D File Offset: 0x0006CA1D
		[BsonIgnore]
		public bool TypeB
		{
			get
			{
				return this.Type == 1;
			}
		}

		// Token: 0x170003D5 RID: 981
		// (get) Token: 0x06000C5A RID: 3162 RVA: 0x0006E828 File Offset: 0x0006CA28
		[BsonIgnore]
		public bool TypeC
		{
			get
			{
				return this.Type == 2;
			}
		}

		// Token: 0x170003D6 RID: 982
		// (get) Token: 0x06000C5B RID: 3163 RVA: 0x0006E833 File Offset: 0x0006CA33
		// (set) Token: 0x06000C5C RID: 3164 RVA: 0x0006E83C File Offset: 0x0006CA3C
		public int Position
		{
			[CompilerGenerated]
			get
			{
				return this.<Position>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<Position>k__BackingField == value)
				{
					return;
				}
				this.<Position>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Position);
			}
		}

		// Token: 0x170003D7 RID: 983
		// (get) Token: 0x06000C5D RID: 3165 RVA: 0x0006E869 File Offset: 0x0006CA69
		// (set) Token: 0x06000C5E RID: 3166 RVA: 0x0006E874 File Offset: 0x0006CA74
		public ObservableCollection<int> ShipID
		{
			get
			{
				return this._shipID;
			}
			set
			{
				if (object.Equals(this._shipID, value))
				{
					return;
				}
				this._shipID = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.ShipName);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.ShipID);
				this.ShipID.CollectionChanged += delegate(object sender, NotifyCollectionChangedEventArgs e)
				{
					base.RaisePropertyChanged("ShipName");
				};
			}
		}

		// Token: 0x170003D8 RID: 984
		// (get) Token: 0x06000C5F RID: 3167 RVA: 0x0006E8C8 File Offset: 0x0006CAC8
		[BsonIgnore]
		public string ShipName
		{
			get
			{
				if (this.ShipID.Count == 0)
				{
					return "点击设置";
				}
				return string.Join(",", from sid in this.ShipID
				select sid.ToName());
			}
		}

		// Token: 0x170003D9 RID: 985
		// (get) Token: 0x06000C60 RID: 3168 RVA: 0x0006E91C File Offset: 0x0006CB1C
		// (set) Token: 0x06000C61 RID: 3169 RVA: 0x0006E924 File Offset: 0x0006CB24
		public string SelectName
		{
			[CompilerGenerated]
			get
			{
				return this.<SelectName>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (string.Equals(this.<SelectName>k__BackingField, value, StringComparison.Ordinal))
				{
					return;
				}
				this.<SelectName>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.SelectName);
			}
		}

		// Token: 0x170003DA RID: 986
		// (get) Token: 0x06000C62 RID: 3170 RVA: 0x0006E955 File Offset: 0x0006CB55
		// (set) Token: 0x06000C63 RID: 3171 RVA: 0x0006E960 File Offset: 0x0006CB60
		public int Number
		{
			[CompilerGenerated]
			get
			{
				return this.<Number>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<Number>k__BackingField == value)
				{
					return;
				}
				this.<Number>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Number);
			}
		}

		// Token: 0x170003DB RID: 987
		// (get) Token: 0x06000C64 RID: 3172 RVA: 0x0006E98D File Offset: 0x0006CB8D
		// (set) Token: 0x06000C65 RID: 3173 RVA: 0x0006E998 File Offset: 0x0006CB98
		public ObservableCollection<ShipType> ShipType
		{
			get
			{
				return this._shipType;
			}
			set
			{
				if (object.Equals(this._shipType, value))
				{
					return;
				}
				this._shipType = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.ShipTypeName);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.ShipType);
				this.ShipType.CollectionChanged += delegate(object sender, NotifyCollectionChangedEventArgs e)
				{
					base.RaisePropertyChanged("ShipTypeName");
				};
			}
		}

		// Token: 0x170003DC RID: 988
		// (get) Token: 0x06000C66 RID: 3174 RVA: 0x0006E9EC File Offset: 0x0006CBEC
		[BsonIgnore]
		public string ShipTypeName
		{
			get
			{
				if (this.ShipType.Count == 0)
				{
					return "点击设置";
				}
				return string.Join(",", from sid in this.ShipType
				select sid.ToName());
			}
		}

		// Token: 0x170003DD RID: 989
		// (get) Token: 0x06000C67 RID: 3175 RVA: 0x0006EA40 File Offset: 0x0006CC40
		// (set) Token: 0x06000C68 RID: 3176 RVA: 0x0006EA48 File Offset: 0x0006CC48
		public int MinLv
		{
			[CompilerGenerated]
			get
			{
				return this.<MinLv>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<MinLv>k__BackingField == value)
				{
					return;
				}
				this.<MinLv>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.MinLv);
			}
		}

		// Token: 0x170003DE RID: 990
		// (get) Token: 0x06000C69 RID: 3177 RVA: 0x0006EA75 File Offset: 0x0006CC75
		// (set) Token: 0x06000C6A RID: 3178 RVA: 0x0006EA80 File Offset: 0x0006CC80
		public int MaxLv
		{
			[CompilerGenerated]
			get
			{
				return this.<MaxLv>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<MaxLv>k__BackingField == value)
				{
					return;
				}
				this.<MaxLv>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.MaxLv);
			}
		}

		// Token: 0x170003DF RID: 991
		// (get) Token: 0x06000C6B RID: 3179 RVA: 0x0006EAAD File Offset: 0x0006CCAD
		// (set) Token: 0x06000C6C RID: 3180 RVA: 0x0006EAB8 File Offset: 0x0006CCB8
		public bool LvOrder
		{
			[CompilerGenerated]
			get
			{
				return this.<LvOrder>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<LvOrder>k__BackingField == value)
				{
					return;
				}
				this.<LvOrder>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.LvOrder);
			}
		}

		// Token: 0x170003E0 RID: 992
		// (get) Token: 0x06000C6D RID: 3181 RVA: 0x0006EAE5 File Offset: 0x0006CCE5
		// (set) Token: 0x06000C6E RID: 3182 RVA: 0x0006EAF0 File Offset: 0x0006CCF0
		public bool IsLock
		{
			[CompilerGenerated]
			get
			{
				return this.<IsLock>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<IsLock>k__BackingField == value)
				{
					return;
				}
				this.<IsLock>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.IsLock);
			}
		}

		// Token: 0x170003E1 RID: 993
		// (get) Token: 0x06000C6F RID: 3183 RVA: 0x0006EB1D File Offset: 0x0006CD1D
		// (set) Token: 0x06000C70 RID: 3184 RVA: 0x0006EB28 File Offset: 0x0006CD28
		public int Equipment1
		{
			[CompilerGenerated]
			get
			{
				return this.<Equipment1>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<Equipment1>k__BackingField == value)
				{
					return;
				}
				this.<Equipment1>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Equipment1Image);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Equipment1);
			}
		}

		// Token: 0x170003E2 RID: 994
		// (get) Token: 0x06000C71 RID: 3185 RVA: 0x0006EB60 File Offset: 0x0006CD60
		// (set) Token: 0x06000C72 RID: 3186 RVA: 0x0006EB68 File Offset: 0x0006CD68
		public int Equipment2
		{
			[CompilerGenerated]
			get
			{
				return this.<Equipment2>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<Equipment2>k__BackingField == value)
				{
					return;
				}
				this.<Equipment2>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Equipment2Image);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Equipment2);
			}
		}

		// Token: 0x170003E3 RID: 995
		// (get) Token: 0x06000C73 RID: 3187 RVA: 0x0006EBA0 File Offset: 0x0006CDA0
		// (set) Token: 0x06000C74 RID: 3188 RVA: 0x0006EBA8 File Offset: 0x0006CDA8
		public int Equipment3
		{
			[CompilerGenerated]
			get
			{
				return this.<Equipment3>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<Equipment3>k__BackingField == value)
				{
					return;
				}
				this.<Equipment3>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Equipment3Image);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Equipment3);
			}
		}

		// Token: 0x170003E4 RID: 996
		// (get) Token: 0x06000C75 RID: 3189 RVA: 0x0006EBE0 File Offset: 0x0006CDE0
		// (set) Token: 0x06000C76 RID: 3190 RVA: 0x0006EBE8 File Offset: 0x0006CDE8
		public int Equipment4
		{
			[CompilerGenerated]
			get
			{
				return this.<Equipment4>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<Equipment4>k__BackingField == value)
				{
					return;
				}
				this.<Equipment4>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Equipment4Image);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Equipment4);
			}
		}

		// Token: 0x170003E5 RID: 997
		// (get) Token: 0x06000C77 RID: 3191 RVA: 0x0006EC20 File Offset: 0x0006CE20
		// (set) Token: 0x06000C78 RID: 3192 RVA: 0x0006EC28 File Offset: 0x0006CE28
		public bool Equipped
		{
			[CompilerGenerated]
			get
			{
				return this.<Equipped>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<Equipped>k__BackingField == value)
				{
					return;
				}
				this.<Equipped>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Equipped);
			}
		}

		// Token: 0x170003E6 RID: 998
		// (get) Token: 0x06000C79 RID: 3193 RVA: 0x0006EC55 File Offset: 0x0006CE55
		// (set) Token: 0x06000C7A RID: 3194 RVA: 0x0006EC60 File Offset: 0x0006CE60
		public bool IsRemoveEquip
		{
			[CompilerGenerated]
			get
			{
				return this.<IsRemoveEquip>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<IsRemoveEquip>k__BackingField == value)
				{
					return;
				}
				this.<IsRemoveEquip>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.IsRemoveEquip);
			}
		}

		// Token: 0x170003E7 RID: 999
		// (get) Token: 0x06000C7B RID: 3195 RVA: 0x0006EC90 File Offset: 0x0006CE90
		[BsonIgnore]
		public string Equipment1Image
		{
			get
			{
				string resourcePath = Runtime.ResourcePath;
				string str = "/Equipment/";
				EquipmentConfig equipmentConfig = Runtime.Configs.shipEquipment.SingleOrDefault((EquipmentConfig se) => se.cid == this.Equipment1);
				return resourcePath + str + (((equipmentConfig != null) ? equipmentConfig.picId : null) ?? "0") + ".jpg";
			}
		}

		// Token: 0x170003E8 RID: 1000
		// (get) Token: 0x06000C7C RID: 3196 RVA: 0x0006ECE4 File Offset: 0x0006CEE4
		[BsonIgnore]
		public string Equipment2Image
		{
			get
			{
				string resourcePath = Runtime.ResourcePath;
				string str = "/Equipment/";
				EquipmentConfig equipmentConfig = Runtime.Configs.shipEquipment.SingleOrDefault((EquipmentConfig se) => se.cid == this.Equipment2);
				return resourcePath + str + (((equipmentConfig != null) ? equipmentConfig.picId : null) ?? "0") + ".jpg";
			}
		}

		// Token: 0x170003E9 RID: 1001
		// (get) Token: 0x06000C7D RID: 3197 RVA: 0x0006ED38 File Offset: 0x0006CF38
		[BsonIgnore]
		public string Equipment3Image
		{
			get
			{
				string resourcePath = Runtime.ResourcePath;
				string str = "/Equipment/";
				EquipmentConfig equipmentConfig = Runtime.Configs.shipEquipment.SingleOrDefault((EquipmentConfig se) => se.cid == this.Equipment3);
				return resourcePath + str + (((equipmentConfig != null) ? equipmentConfig.picId : null) ?? "0") + ".jpg";
			}
		}

		// Token: 0x170003EA RID: 1002
		// (get) Token: 0x06000C7E RID: 3198 RVA: 0x0006ED8C File Offset: 0x0006CF8C
		[BsonIgnore]
		public string Equipment4Image
		{
			get
			{
				string resourcePath = Runtime.ResourcePath;
				string str = "/Equipment/";
				EquipmentConfig equipmentConfig = Runtime.Configs.shipEquipment.SingleOrDefault((EquipmentConfig se) => se.cid == this.Equipment4);
				return resourcePath + str + (((equipmentConfig != null) ? equipmentConfig.picId : null) ?? "0") + ".jpg";
			}
		}

		// Token: 0x06000C7F RID: 3199 RVA: 0x0006EDE0 File Offset: 0x0006CFE0
		public RuleFleet()
		{
			this.ShipType.CollectionChanged += delegate(object sender, NotifyCollectionChangedEventArgs e)
			{
				base.RaisePropertyChanged("ShipTypeName");
			};
			this.ShipID.CollectionChanged += delegate(object sender, NotifyCollectionChangedEventArgs e)
			{
				base.RaisePropertyChanged("ShipName");
			};
		}

		// Token: 0x04000A8B RID: 2699
		private ObservableCollection<int> _shipID = new ObservableCollection<int>();

		// Token: 0x04000A8C RID: 2700
		private ObservableCollection<ShipType> _shipType = new ObservableCollection<ShipType>();
	}
}
